home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus 1995 #5 & #6
/
Amiga Plus CD - 1995 - No. 5 and 6.iso
/
pd
/
serien
/
purity
/
nr.15
/
kickpascal-programme
/
gbu
/
gbu1.p
< prev
next >
Wrap
Text File
|
1995-04-22
|
10KB
|
349 lines
PROGRAM uline_demo;
USES Intuition;
TYPE ImageFeld=ARRAY[1..18]OF LONG;
Strtyp=STRING[100];
CONST SELFLAGS:=GADGHIMAGE+GADGIMAGE+SELECTED;
NORFLAGS:=GADGHIMAGE+GADGIMAGE;
VAR win3:p_window;STATIC;
BImage1,BImage2:Image;STATIC;
Buttonptr1,Buttonptr2:^ImageFeld;STATIC;
MessagePtr1: p_IntuiMessage;STATIC;
aktgad:p_gadget;STATIC;
akt,ende:BOOLEAN;STATIC;
Txtinfo11:STRINGINFO;STATIC;
Puffer11:String;STATIC;
ok:LONG;STATIC;
gads:ARRAY[1..13] OF GADGET;STATIC;
txts:ARRAY[1..13] OF INTUITEXT;STATIC;
lauf:INTEGER;STATIC;
PROCEDURE umrandung(wo:p_window,c1,c2,x,y,b,h:INTEGER);
TYPE umrandungstyp=ARRAY[0..9] OF INTEGER;
VAR Feld1,feld2:umrandungstyp;
border1,border2:BORDER;
BEGIN
feld1:=umrandungstyp(1,1,1,h-2,0,h-1,0,0,b-2,0);
feld2:=umrandungstyp(b-2,h-2,b-2,1,b-1,0,b-1,h-1,1,h-1);
Border1:=Border(x,y,c1,0,0,5,^Feld1,^Border2);
Border2:=Border(x,y,c2,0,0,5,^Feld2,Nil);
drawborder(wo^.rport,^Border1,0,0);
END;
PROCEDURE gbord(wo:p_window,was:p_gadget);
BEGIN
umrandung(wo,2,1,was^.Leftedge,was^.Topedge,was^.Width,was^.height);
END;
PROCEDURE zeichnetext(c1,c2:SHORT,wo:p_window,x,y:INTEGER,text:strtyp);
VAR it1,it2:INTUITEXT;STATIC;
BEGIN
it1:=INTUITEXT(c1,0,JAM2,1,1,NIL,text,^it2);
it2:=INTUITEXT(c2,0,0,0,0,NIL,text,NIL );
PRINTITEXT(wo^.rport,^it1,x,y);
END;
PROCEDURE uline(wo:p_window,was:p_gadget,c:CHAR);
VAR it:intuitext;STATIC;
x,y:LONG;STATIC;
stelle:INTEGER;
BEGIN
IF was^.Gadgettext<> NIL THEN
BEGIN
stelle:=POS(c,was^.gadgettext^.itext);
If stelle>0 THEN
BEGIN
stelle:=stelle-1;
x:=was^.Gadgettext^.leftedge+was^.Leftedge+8*stelle;
y:=was^.Gadgettext^.topedge+was^.Topedge+1;
it:=INTUITEXT(1,0,0,0,0,NIL,'_',NIL );
PRINTITEXT(wo^.rport,^it,x,y);
END;
END;
END;
PROCEDURE gbu(wo:p_window,was:p_gadget,c:CHAR);
BEGIN
gbord(wo,was);
uline(wo,was,c);
END;
PROCEDURE stringumrandung(wo:p_window,c1,c2,x,y,b,h:WORD);
BEGIN
umrandung(wo,c1,c2,x,y,b,h);
umrandung(wo,c2,c1,x-2,y-1,b+4,h+2);
END;
PROCEDURE p1;
BEGIN
gads[1].Flags:=SELFLAGS;
gads[2].Flags:=NORFLAGS;
gads[3].Flags:=NORFLAGS;
gads[4].Flags:=NORFLAGS;
gads[5].Flags:=NORFLAGS;
REFRESHGADGETS(win3^.firstgadget,win3,NIL);
END;
PROCEDURE p2;
BEGIN
gads[1].Flags:=NORFLAGS;
gads[2].Flags:=SELFLAGS;
gads[3].Flags:=NORFLAGS;
gads[4].Flags:=NORFLAGS;
gads[5].Flags:=NORFLAGS;
REFRESHGADGETS(win3^.firstgadget,win3,NIL);
END;
PROCEDURE p3;
BEGIN
gads[1].Flags:=NORFLAGS;
gads[2].Flags:=NORFLAGS;
gads[3].Flags:=SELFLAGS;
gads[4].Flags:=NORFLAGS;
gads[5].Flags:=NORFLAGS;
REFRESHGADGETS(win3^.firstgadget,win3,NIL);
END;
PROCEDURE p4;
BEGIN
gads[1].Flags:=NORFLAGS;
gads[2].Flags:=NORFLAGS;
gads[3].Flags:=NORFLAGS;
gads[4].Flags:=SELFLAGS;
gads[5].Flags:=NORFLAGS;
REFRESHGADGETS(win3^.firstgadget,win3,NIL);
END;
PROCEDURE p5;
BEGIN
gads[1].Flags:=NORFLAGS;
gads[2].Flags:=NORFLAGS;
gads[3].Flags:=NORFLAGS;
gads[4].Flags:=NORFLAGS;
gads[5].Flags:=SELFLAGS;
REFRESHGADGETS(win3^.firstgadget,win3,NIL);
END;
PROCEDURE p6;
BEGIN
gads[6].Flags:=SELFLAGS;
gads[7].Flags:=NORFLAGS;
REFRESHGADGETS(win3^.firstgadget,win3,NIL);
END;
PROCEDURE p7;
BEGIN
gads[6].Flags:=NORFLAGS;
gads[7].Flags:=SELFLAGS;
REFRESHGADGETS(win3^.firstgadget,win3,NIL);
END;
PROCEDURE p8;
BEGIN
gads[8].Flags:=SELFLAGS;
gads[9].Flags:=NORFLAGS;
REFRESHGADGETS(win3^.firstgadget,win3,NIL);
END;
PROCEDURE p9;
BEGIN
gads[8].Flags:=NORFLAGS;
gads[9].Flags:=SELFLAGS;
REFRESHGADGETS(win3^.firstgadget,win3,NIL);
END;
PROCEDURE p10;
BEGIN
IF (gads[10].Flags AND SELECTED) <> 0 THEN gads[10].Flags:=NORFLAGS
ELSE gads[10].Flags:=SELFLAGS;
REFRESHGADGETS(win3^.firstgadget,win3,NIL);
END;
{ ***************************************************************}
BEGIN
win3:=Open_Window(150,70,290,110,1,
_CLOSEWINDOW+GADGETUP+GADGETDOWN+VANILLAKEY,
WINDOWDRAG+WINDOWDEPTH+WINDOWCLOSE+ACTIVATE,
'Røgerdat! Datensatz suchen',NIL,50,50,640,256);
gads[1]:=GADGET(NIL,20,15,17,9,NORFLAGS,RELVERIFY+TOGGLESELECT,
BOOLGADGET,^BImage1,^BImage2,^txts[1],0,NIL,1,NIL);
txts[1]:=INTUITEXT(1,0,0,25,1,NIL,'Vorname',NIL);
uline(win3,^gads[1],'V');
gads[2]:=GADGET(NIL,20,25,17,9,SELFLAGS,RELVERIFY+TOGGLESELECT,
BOOLGADGET,^BImage1,^BImage2,^txts[2],0,NIL,2,NIL);
txts[2]:=INTUITEXT(1,0,0,25,1,NIL,'Name',NIL);
uline(win3,^gads[2],'N');
gads[3]:=GADGET(NIL,20,35,17,9,NORFLAGS,RELVERIFY+TOGGLESELECT,
BOOLGADGET,^BImage1,^BImage2,^txts[3],0,NIL,3,NIL);
txts[3]:=INTUITEXT(1,0,0,25,1,NIL,'Ort',NIL);
uline(win3,^gads[3],'O');
gads[4]:=GADGET(NIL,20,45,17,9,NORFLAGS,RELVERIFY+TOGGLESELECT,
BOOLGADGET,^BImage1,^BImage2,^txts[4],0,NIL,4,NIL);
txts[4]:=INTUITEXT(1,0,0,25,1,NIL,'Straße',NIL);
uline(win3,^gads[4],'r');
gads[5]:=GADGET(NIL,20,55,17,9,NORFLAGS,RELVERIFY+TOGGLESELECT,
BOOLGADGET,^BImage1,^BImage2,^txts[5],0,NIL,5,NIL);
txts[5]:=INTUITEXT(1,0,0,25,1,NIL,'Telefon',NIL);
uline(win3,^gads[5],'T');
{**********}
gads[6]:=GADGET(NIL,130,15,17,9,NORFLAGS,RELVERIFY+TOGGLESELECT,
BOOLGADGET,^BImage1,^BImage2,^txts[6],0,NIL,6,NIL);
txts[6]:=INTUITEXT(1,0,0,25,1,NIL,'innerhalb',NIL);
uline(win3,^gads[6],'i');
gads[7]:=GADGET(NIL,130,25,17,9,SELFLAGS,RELVERIFY+TOGGLESELECT,
BOOLGADGET,^BImage1,^BImage2,^txts[7],0,NIL,7,NIL);
txts[7]:=INTUITEXT(1,0,0,25,1,NIL,'genau',NIL);
uline(win3,^gads[7],'g');
{*********}
gads[8]:=GADGET(NIL,130,35,17,9,NORFLAGS,RELVERIFY+TOGGLESELECT,
BOOLGADGET,^BImage1,^BImage2,^txts[8],0,NIL,8,NIL);
txts[8]:=INTUITEXT(1,0,0,25,1,NIL,'von Anfang',NIL);
uline(win3,^gads[8],'A');
gads[9]:=GADGET(NIL,130,45,17,9,SELFLAGS,RELVERIFY+TOGGLESELECT,
BOOLGADGET,^BImage1,^BImage2,^txts[9],0,NIL,9,NIL);
txts[9]:=INTUITEXT(1,0,0,25,1,NIL,'nächster',NIL);
uline(win3,^gads[9],'ä');
{*********}
gads[10]:=GADGET(NIL,130,55,17,9,SELFLAGS,RELVERIFY+TOGGLESELECT,
BOOLGADGET,^BImage1,^BImage2,^txts[10],0,NIL,10,NIL);
txts[10]:=INTUITEXT(1,0,0,25,1,NIL,'Ignorieren G/k',NIL);
uline(win3,^gads[10],'e');
{***************}
gads[11]:=GADGET(NIL,110,72,156,10,GADGHCOMP,RELVERIFY,
STRGADGET,NIL,NIL,^txts[11],0,^txtinfo11,11,NIL);
txts[11]:=INTUITEXT(1,0,0,-90,0,NIL,'Suchstring',NIL);
uline(win3,^gads[11],'u');
Txtinfo11:=StringInfo(^Puffer11,NIL,0,80,0,0,0,0,0,0,NIL,0,NIL);
Puffer11:='';
stringumrandung(win3,1,2,106,70,158,12);
{****************}
gads[12]:=GADGET(NIL,20,90,100,13,GADGHCOMP,RELVERIFY,
BOOLGADGET,NIL,NIL,^txts[12],0,NIL,12,NIL);
txts[12]:=INTUITEXT(1,0,0,35,2,NIL,'Quit',NIL);
gbu(win3,^gads[12],'Q');
gads[13]:=GADGET(NIL,166,90,100,13,GADGHCOMP,RELVERIFY,
BOOLGADGET,NIL,NIL,^txts[13],0,NIL,13,NIL);
txts[13]:=INTUITEXT(1,0,0,25,2,NIL,'Suchen',NIL);
gbu(win3,^gads[13],'S');
Buttonptr1:=PTR(ALLOC_MEM(SizeOf(ImageFeld),2));
Buttonptr1^:=ImageFeld(%00000000000000100000000000000000,
%00000000000000110000000000000000,
%00000000000000011000000000000000,
%00000000000000011000000000000000,
%00000000000000011000000000000000,
%00000000000000011000000000000000,
%00000000000000011000000000000000,
%00000000000000110000000000000000,
%00011111111111100000000000000000,
{ 2. Bitplane } %00111111111111000000000000000000,
%01100000000000000000000000000000,
%11000000000000000000000000000000,
%11000000000000000000000000000000,
%11000000000000000000000000000000,
%11000000000000000000000000000000,
%11000000000000000000000000000000,
%01100000000000000000000000000000,
%00100000000000000000000000000000);
Buttonptr2:=PTR(ALLOC_MEM(SizeOf(ImageFeld),2));
Buttonptr2^:=ImageFeld(%00111111111111000000000000000000,
%01100000000000000000000000000000,
%11000111111100000000000000000000,
%11001111111110000000000000000000,
%11001111111110000000000000000000,
%11001111111110000000000000000000,
%11000111111100000000000000000000,
%01100000000000000000000000000000,
%00100000000000000000000000000000,
{ 2. Bitplane } %00000000000000100000000000000000,
%00000000000000110000000000000000,
%00000111111100011000000000000000,
%00001111111110011000000000000000,
%00001111111110011000000000000000,
%00001111111110011000000000000000,
%00000111111100011000000000000000,
%00000000000000110000000000000000,
%00011111111111100000000000000000);
BImage1:=IMAGE(0,0,17,9,2,Buttonptr1,3,0,NIL);
BImage2:=IMAGE(0,0,17,9,2,Buttonptr2,3,0,NIL);
ende:=FALSE;
FOR lauf:=1 TO 13 DO ok:=ADDGADGET(win3,^gads[lauf],0);
REFRESHGADGETS(win3^.firstgadget,win3,NIL);
akt:=activategadget(^gads[2],win3,NIL);
REPEAT
MessagePtr1:=p_Intuimessage(Waitport(win3^.Userport));
MessagePtr1:=p_Intuimessage(GetMsg(win3^.Userport));
CASE MessagePtr1^.class OF
_CLOSEWINDOW: ende:=TRUE;
GADGETUP,GADGETDOWN:
BEGIN
aktgad:=messageptr1^.iaddress;
CASE aktgad^.gadgetID OF
1:p1;
2:p2;
3:p3;
4:p4;
5:p5;
6:p6;
7:p7;
8:p8;
9:p9;
12:ende:=TRUE;
13:;
OTHERWISE
END;
END;
VANILLAKEY:
CASE messageptr1^.code OF
86,118: p1;
78,110: p2;
79,111: p3;
82,114: p4;
84,116: p5;
73,105: p6;
71,103: p7;
65,97 : p8;
196,228:p9;
69,101: p10;
85,117: akt:=activategadget(^gads[11],win3,NIL);
83,115: {suchen};
27,81,113: ende:=TRUE;
OTHERWISE;
END;
OTHERWISE;
END; {OF CASE}
ReplyMsg(p_Message(MessagePtr1));
UNTIL ende;
Closewindow(win3);
Free_Mem(LONG(Buttonptr1),SizeOf(ImageFeld));
Free_Mem(LONG(Buttonptr2),SizeOf(ImageFeld));
END.